Print a more useful error message when the target binary can't be removed.
authorTed Mielczarek <ted@mielczarek.org>
Wed, 27 Jul 2016 15:22:06 +0000 (11:22 -0400)
committerTed Mielczarek <ted@mielczarek.org>
Wed, 27 Jul 2016 15:22:06 +0000 (11:22 -0400)
commit9f4330d6c17675273e7037971ce24beb949376fd
tree33b560f8adc119503785a52be184b70c37c4c2f0
parent4404c62fe5939c10f1c3816a54d960f1c924bc5d
Print a more useful error message when the target binary can't be removed.

This happens sometimes on Windows if the target is still running, and right
now cargo prints a very cryptic message:
```
$ cargo build
   Compiling sccache v0.1.0 (file:///C:/build/sccache2)
An unknown error occurred
```

With this patch we get a much more useful error:
```
$ ../cargo/target/debug/cargo build
   Compiling sccache v0.1.0 (file:///C:/build/sccache2)
error: Could not remove file: c:\build\sccache2\target\debug\sccache.exe.

To learn more, run the command again with --verbose.
```
src/cargo/ops/cargo_rustc/mod.rs